<template>
	<view id="parent">
		<uni-section style="margin: 0;" :title="title" :sub-title="time_" type="line">
			{{createBy}}
		</uni-section>
		<view id="child">
			<rich-text :nodes="content"></rich-text>
		</view>
	</view>
</template>


<script>
	import {
		advert
	} from '@/api/index'
	export default {
		data() {
			return {
				title: '',
				time: '',
				createBy: '',
				content: ''
			}
		},
		computed: {
			time_() {
				return this.time.replace("T", " ")
			}
		},
		onLoad() {
			advert().then(res => {
				console.log('--res--', res)
				let data = res.data
				this.title = data.title;
				this.time = data.time;
				this.createBy = data.createBy
				this.content = data.content
			}).catch(e => {
				console.log(e)
				this.$modal.msgLoading('暂无')

			})
		},
	}
</script>
<style>
	#parent {
		display: flex;
		flex-direction: column;
		height: 100vh;

		#child {
			flex: 1;
			background: #f8f8f8;
			margin: 4px;
			padding: 6px;
			border-radius: 4px;
		}
	}
</style>